package com.cn.wanxi.service;

import com.cn.wanxi.model.NewsModel;

import java.util.ArrayList;
import java.util.List;

public class NewsService {
    private List<NewsModel> list = new ArrayList<>();

    public List<NewsModel> getList() {
        NewsModel temp=new NewsModel();//目的，得到数组里面的值
        String titles[]=temp.getTitles();
        String contents[]=temp.getContents();
        for (int i=0;i<titles.length;i++){
            NewsModel newsModel=new NewsModel();//封装新闻对象
            newsModel.setTitle(titles[i]);
            newsModel.setContent(contents[i]);
            list.add(newsModel);
        }
        return list;
    }

}
